package cn.itsource.pethome.web.controller;

import cn.itsource.pethome.domain.Employee;
import cn.itsource.pethome.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class EmployeeController {

    @Autowired
    private IEmployeeService employeeService;

    /**
     * 根据职位查询员工
     * @param jobId
     * @return
     */
    @GetMapping("/employee/findAllByJobId/{jobId}")
    public List<Employee> findAllByJobId(@PathVariable("jobId")Long jobId){
        return employeeService.findAllByJobId(jobId);
    }

}
